# @author: xushijia

# @time: 2025/05/20 15:50

from utils.read_yaml import Read_yaml
from utils.tools import get_project_name, sep

class ttsModuleAlarmBase:

    def __init__(self, yaml_path):
        # 获取yaml配置
        self.login_config = Read_yaml(yaml_path).get_config_data("ttsModuleAlarm_config")

    def loginWindow_Skip(self):
        """
        登錄界面彈窗跳過定位
        :return:
        """
        return self.login_config["ttsModuleAlarm_config"]["loginWindowSkip"]

    def alarm_center(self):
        """
        报警中心
        :return:
        """
        return self.login_config["ttsModuleAlarm_config"]["alarmCenter"]

    def alarm_rules(self):
        """
        报警规则
        :return:
        """
        return self.login_config["ttsModuleAlarm_config"]["alarmRules"]

    def base_Alarm_Rules(self):
        """
        基础报警
        :return:
        """
        return self.login_config["ttsModuleAlarm_config"]["baseAlarmRules"]

    def input_is_selected(self):
        """
        车辆报警项全选 input框
        :return:
        """
        return self.login_config["ttsModuleAlarm_config"]["carAlarmCelect"]

    def get_simulator_conf_parameters(self):
        """
        获取模拟器 simulator_conf 配置文件参数
        :return:
        """

        # 获取phone
        phone = self.login_config["dev"]["phone"]
        terminalNum = self.login_config["dev"]["terminalNum"]
        serverIP = self.login_config["env"]["serverIP"]
        serverPort = self.login_config["env"]["serverPort"]
        fullGps = self.login_config["env"]["fullGps"]
        conf_path = self.login_config["filepath"]["conf_path"]
        gps_info = self.login_config["filepath"]["gps_info"]

        return phone, terminalNum, serverIP, serverPort, fullGps, conf_path, gps_info

    def get_exe_path(self):
        """
        获取exe_path 路径地址
        :return:
        """

        return self.login_config["filepath"]["exe_path"]

    def get_alarm_center(self):
        """
        报警台账
        :return:
        """
        return self.login_config["ttsModuleAlarm_config"]["alarmLedger"]

    # def get_alarm_ledger_clear_button(self):
    #     """
    #     报警条件清除
    #     :return:
    #     """
    #     return self.login_config["ttsModuleAlarm_config"]["alarmLedgerClearButton"]

    def get_alarm_type(self):
        """
        定位报警类型控件
        :return:
        """
        return self.login_config["ttsModuleAlarm_config"]["alarmType"]

    def get_alarm_type_input(self):
        """
        选择TTS模块故障报警
        :return:
        """
        return self.login_config["ttsModuleAlarm_config"]["alarmTypeInput"]

    def get_car_num_input(self):
        """
        定位车牌号控件，输入选择对应控件
        :return:
        """
        return self.login_config["ttsModuleAlarm_config"]["carNum"], \
            self.login_config["ttsModuleAlarm_config"]["carNum_input"]

    def car_id(self):
        """
        车牌号
        :return:
        """
        return self.login_config["dev"]["car_id"]

    def get_start_end_time(self):
        """
        报警开始结束时间
        :return:
        """
        return self.login_config["ttsModuleAlarm_config"]["start_input_time"], \
            self.login_config["ttsModuleAlarm_config"][
                "end_input_time"]

    def query_button(self):
        """
        查询按钮
        :return:
        """
        return self.login_config["ttsModuleAlarm_config"]["query_button"]

    def result_element_tr(self):
        """
        报警上报条件
        :return:
        """
        return self.login_config["ttsModuleAlarm_config"]["alarm_result"]